package keeto.com.vn.bms.ui.adapter;

import java.util.ArrayList;

import keeto.com.vn.bms.model.User.Doctor;
import keeto.com.vn.bms.ui.activity.R;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class ListStatisticDoctorAdapter extends ArrayAdapter<Doctor> {
	private Context mContext;

	public ListStatisticDoctorAdapter(Context context, int resource,
			ArrayList<Doctor> doctors) {
		super(context, 0, doctors);
		// TODO Auto-generated constructor stub
		this.mContext = context;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View view = convertView;
		if (view == null) {
			LayoutInflater inflater = (LayoutInflater) mContext
					.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
			view=inflater.inflate(R.layout.item_statistic_doctor, parent, false);
		}
		final Doctor doctor= getItem(position);
		TextView txtNameDoctor=(TextView)view.findViewById(R.id.txt_doctor);
		if(doctor.getFullName()!=null)
			txtNameDoctor.setText(doctor.getFullName());
		return view;
	}

}
